package com.example.a.logdemo;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {
    private static final String ACTIVITY_TAG="firstacitivity";;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        Log.e(ACTIVITY_TAG,"FirstAcvity --->onCreate");
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Button bt = (Button)findViewById(R.id.bt);
        bt.setOnClickListener(new Button.OnClickListener(){
            @Override
            public void onClick(View v) {

                    Intent intent = new Intent();

                    intent.setClass(MainActivity.this,secondacitivity.class);
                    MainActivity.this.startActivity(intent);


            }
        });
    }

    @Override
    protected void onPostResume() {
        Log.v(ACTIVITY_TAG,"FirstAcvity --->onPostResume");
        super.onPostResume();
    }

    @Override
    protected void onStart() {
        Log.e(ACTIVITY_TAG,"FirstAcvity --->onStart");
        super.onStart();
    }

    @Override
    protected void onStop() {
        Log.e(ACTIVITY_TAG,"FirstAcvity --->onStop");
        super.onStop();
    }

    @Override
    protected void onPause() {
        Log.e(ACTIVITY_TAG,"FirstAcvity --->onDestory");
        super.onPause();
    }

    @Override
    protected void onRestart() {
        Log.e(ACTIVITY_TAG,"FirstAcvity --->onRestart");
        super.onRestart();
    }
    @Override
    protected void onDestroy() {
        Log.e(ACTIVITY_TAG,"FirstAcvity --->onDestory");
        super.onDestroy();
    }
}
